home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / cpp_libs / answrbok / 5_5.lha / 5_5 / 5_5e_all.c < prev    next >
C/C++ Source or Header  |  1993-08-08  |  1KB  |  54 lines

  1. * Copyright (c) 1990 by AT&T Bell Telephone Laboratories, Incorporated. */
  2. * The C++ Answer Book */
  3. * Tony Hansen */
  4. * All rights reserved. */
  5. include <stream.h>
  6. include <string.h>
  7. include <ctype.h>
  8. include <debug.h>
  9. nt error(const char *fmt ...);
  10.  
  11. har prefix[512] = "....", *endprefix = &prefix[1];
  12. har *incr()
  13.  
  14.    *endprefix++ = '.';
  15.    *endprefix = '\0';
  16.    return prefix+1;
  17.  
  18. har *decr()
  19.  
  20.    *--endprefix = '\0';
  21.    return prefix;
  22.  
  23.  
  24. har *unctrl(unsigned int c)
  25.  
  26.    static char x[5];
  27.    char *p = x;
  28.  
  29.    if (c > 0177)
  30. *p++ = 'M', *p++ = '-', c -= 0200;
  31.    if ((c < 040) || (c == 0177))
  32. *p++ = '^', *p++ = c ^ 0100;
  33.    else
  34. *p++ = c;
  35.    *p = '\0';
  36.    return x;
  37.  
  38.  
  39. include "5_5A.h"    /* enum exprtype */
  40. include "5_5E.h"    /* class tree, expr, token */
  41.  
  42. include "5_5a0.c"    /* forward declarations */
  43.  
  44. include "5_5e5.c"    /* prim() */
  45. include "5_5e4.c"    /* term() */
  46. include "5_5e3.c"    /* get_expr() */
  47. include "5_5a2.c"    /* gettoken() */
  48. include "5_5e1.c"    /* expandtree, expr::expr() */
  49.  
  50. include "5_5f2.c"    /* treeval() */
  51. include "5_5f1.c"    /* expr::eval() */
  52.  
  53. include "main.c"
  54.